﻿<Page x:Class="Rifts.Creator.SecondarySkills"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	  mc:Ignorable="d" 
	  d:DesignHeight="300" d:DesignWidth="300"
	Title="Secondary Skills">

	<Page.Resources>
		<DataTemplate x:Key="WorkAround">
			<!-- https://connect.microsoft.com/VisualStudio/feedback/details/560631 -->
			<Button Margin="4" MinWidth="100" MinHeight="25" Click="Button_Click" Padding="8,4,8,4"  IsEnabled="{Binding MetRequirements}">
				<StackPanel Orientation="Horizontal" >
					<TextBlock Text="{Binding Name}" />
					<TextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotZeroToVisibleConverter}}" />
				</StackPanel>
			</Button>
		</DataTemplate>
	</Page.Resources>

	<ScrollViewer>
		<StackPanel>
			<TextBlock Text="Select Seconday Skills" />
			<ItemsControl ItemsSource="{Binding SecondarySkills}" DockPanel.Dock="Left" >
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Expander Header="{Binding Name}" >
							<ItemsControl ItemsSource="{Binding}" ItemTemplate="{DynamicResource WorkAround}"/>
						</Expander>
					</DataTemplate>
				</ItemsControl.ItemTemplate>
			</ItemsControl>
		</StackPanel>
	</ScrollViewer>
</Page>
